package cn.ycms.web.action.admin.Permi;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sun.org.apache.regexp.internal.RE;

import cn.ycms.bean.Grou;
import cn.ycms.service.GrouService;
import cn.ycms.utils.StringUtils;
import cn.ycms.web.action.Action;

@Controller
public class GrouAction extends Action{
	@Autowired
	private GrouService grouService;
	@RequestMapping("/admin/GrouAdd")
	public void GrouAdd(HttpServletRequest request,Grou grou)
	{  
	grouService.save(grou);
	
	}
	@RequestMapping("/admin/Groudelete")
	public String Groudelete(HttpServletRequest request,String id)
	{    
	    grouService.FalseDeleteByID(id);
		return "/admin/Groudelete.jsp";
	}
	@RequestMapping("/admin/GrouEdit")
	public String GrouEdit(HttpServletRequest request,Grou grou)
	{
		grouService.UpdateEntity(grou);
		return "/admin/GrouEdit.jsp";
	}
	@RequestMapping("/admin/Groulist")
    public String Groulist(HttpServletRequest request,HttpServletResponse response,int Start,int limit,Map<String, Object> parms)
    {
		int start=StringUtils.getPositiveInt(Start);
		int limit1=StringUtils.getPositiveInt(limit, 10);
	    request.setAttribute("list", grouService.GetEntitybyPage(parms, start, limit1));
    	return "/admin/Groulist.jsp";
    }

}
